<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>16Vue中的class</title>
</head>
<body>

  <div id='app'>
    <div :class="a">div</div>
    <div :class="[a,b,'box3',1>2?'a':'b']">数组</div>
    <div :class="{isActive}"></div>
    <div :class="{isActive:1!=2}"></div>
    <div :class="[a,b,'box3',{isActive},1>2?'a':'b']"></div>
  </div>

<script src='https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js'></script>
<script>
  const app = new Vue({
    el: '#app'
    ,data:{
      a: 'box'
      ,b: 'box2'
      ,isActive: true
    }
  })
</script>
</body>
</html>